Page({
  data: {
    //定义枚举
    statusMsg: {
      1: '审核中',
      2: '审核通过',
      3: '审核失败'
    },
    //定义枚举类型
    statusType: {
      1: 'info',
      2: 'success',
      3: 'fail'
    }
  },
  editHouse() {
    wx.navigateTo({
      url: '/house_pkg/pages/form/index?id=' + this.data.id,
    })
  },
  onLoad({ id }) {
    // console.log(id);
    this.getRoomDetail(id)
    this.setData({
      id
    })
  },
  //获取房屋详情
  async getRoomDetail(id) {
    const res = await wx.http.get(`/room/${id}`)
    console.log(res, '详情');
    this.setData({
      ...res.data
    })
  }
})
